<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of "myWiWall".
# Copyright (c) 2007-2008 CRP Henri Tudor and contributors.
# All rights reserved.
#
# "myWiWall" is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
# 
# "myWiWall" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "myWiWall"; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title><?php echo ViewUtil::retrieveCopLabel(); ?></title>
	    
	    <!-- Style sheets -->
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/common.css" />
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/forms.css" />
		<link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/preferences.css" />
		<!--[if IE]>
		<link type="text/css" rel="stylesheet" media="all" href="../../views/myWiWall/css/fix-ie7.css"/>
		<![endif]-->
	</head>

	<body>
		<div id="header">
			<?php if ($copName = ViewUtil::retrieveCopName()): ?>
			<div id="organization_name"><?php echo $copName; ?></div>
			<?php endif; ?>
			<img id="logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/logo.png"/>
			<a id="header_action" href="../../index.php/wall/index"><?php echo __("Back to the portal"); ?></a>
			<div id="control">
				<ul id="user_info">
					<li><?php echo Auth::getUserName();?></li>
				</ul>
				
				<ul>
					<?php if ($widgetManagement) : ?>
					<li><a id="administration" href="../../index.php/admin/index"><?php echo __("Administration"); ?></a></li>
					<?php endif; ?>
					<li><a id="preferences" href="#"><?php echo __("My preferences"); ?></a></li>
					<li><a id="help" href="../../index.php/help/index"><?php echo __("Online help"); ?></a></li>
				</ul>
				
				<ul>
					<li><a id="logout" href="../../index.php/users/logout"><?php echo __('Logout'); ?></a></li>
				</ul>
			</div>
		</div>
		<div id="content">
			
			<div class="section">
				<h1><?php echo __("My preferences"); ?></h1>
				
				<form id="user_preferences" method="post" action="../../index.php/users/editPreferences">	
			
				<?php
				if (isset($message) && !$isError)
					printf('<div id="message">%s</div>', $message);
				
				else if (isset($message) && $isError)
					printf('<div id="error">%s</div>', $message);
				?>
			
				<fieldset id="password_section">
					<legend><?php echo __("Identifiers"); ?></legend>
					<div class="form_line">
						<label for="old_password"><?php echo __('Old password'); ?></label>
						<input class="text" type="password" id="old_password" name="old_password" tabindex="1"/>
					</div>
					<div class="form_line">
						<label for="new_password"><?php echo __('New password'); ?></label>
						<input class="text" type="password" id="new_password" name="new_password" tabindex="2"/>
					</div>
					<div class="form_line">
						<label for="new_password_confirm"><?php echo __('Confirm new password'); ?></label>
						<input class="text" type="password" id="new_password_confirm" name="new_password_confirm" tabindex="3"/>
					</div>
				</fieldset>
				
				<?php if (OPENID_SSO_MODE): ?>
				<fieldset>
					<legend><?php echo __("OpenID"); ?></legend>
					<div class="form_line">
					<label for="openid"><?php echo __('OpenID identifier'); ?></label>
					<input class="text" type="text" id="openid" name="openid" tabindex="4" value="<?php echo $openId; ?>"/>
					</div>
				</fieldset>
				<?php endif; ?>
				
				<fieldset>
					<legend><?php echo __("Language"); ?></legend>
					<label for="language"><?php echo __('User interface language'); ?></label>
					<select id="language" name="language" tabindex="5">
						<?php foreach ($availableLanguages as $lg => $translation): ?>
						<option value="<?php echo $lg; ?>" <?php if ($userLanguage == $lg) echo 'selected="true"' ?>><?php echo $translation; ?></option>
						<?php endforeach; ?>
					</select>
				</fieldset>
				
				<div class="additional_info">
					<?php echo __("The field 'Old password' must be filled in only if you want to change your password."); ?>
				</div>
				
				<div class="submit">
					<input type="submit" class="button" value="<?php echo __('Save'); ?>" id="user_pref" name="user_pref" tabindex="6"/>
					<input type="reset" class="button" value="<?php echo __('Reset'); ?>" tabindex="7"/>
				</div>		
			</form>
			</div>
			
		</div>
		
		<div id="footer">
			<a href="http://europa.eu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-eu.png" alt="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>" title="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>"/></a>
			<a href="http://www.tudor.lu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-tudor.png" alt="<?php echo __("Public Research Center Henri Tudor"); ?>" title="<?php echo __("Centre de Recherche Public Henri Tudor"); ?>"/></a>
			<p>
				<?php echo __("Copyright 2007-2008 Public Research Center Henri Tudor."); ?>
			</p>
		</div>
	</body>
</html>